//
//  LeftViewController.m
//  self.LeftSlideView
//
//  Created by dllo on 15/12/8.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "LeftViewController.h"
#import "AppDelegate.h"
#import "OtherViewController.h"

@interface LeftViewController ()<UITableViewDataSource, UITableViewDelegate>

@property (nonatomic,retain) UITableView *tableV;
@end

@implementation LeftViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor orangeColor];
    UIImageView *ImageV = [[UIImageView alloc] initWithFrame:self.view.frame];
    ImageV.image = [UIImage imageNamed:@"image1.jpg"];
    [self.view addSubview:ImageV];
    
    self.tableV = [[UITableView alloc] initWithFrame:self.view.frame style:UITableViewStylePlain];
    self.tableV.delegate = self;
    self.tableV.dataSource = self;
    [self.view addSubview:self.tableV];
    [self.tableV release];

}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 12;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    AppDelegate *tempAPP = (AppDelegate *)[[UIApplication sharedApplication] delegate];
    
    OtherViewController *OtherVC = [[OtherViewController alloc] init];
    [tempAPP.leftSlideVC closeLeftView];
    [tempAPP.rootNC pushViewController:OtherVC animated:YES];
    
    
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *cellStr = @"cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellStr];
    if (nil == cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellStr];
        cell.backgroundColor  = [UIColor clearColor];
        cell.textLabel.textColor = [UIColor whiteColor];
    }
    if (5 == indexPath.row) {
        cell.textLabel.text = @"我的QQ";
    } else if (6 == indexPath.row) {
        cell.textLabel.text = @"设置";
    }
    
    
    return cell;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
